<?php

namespace catchAdmin\phone\common;

use catcher\base\CatchController;
use catcher\CatchAdmin;
use catcher\CatchResponse;
use catcher\Code;
use catcher\exceptions\FailedException;
use thans\jwt\exception\TokenBlacklistException;
use thans\jwt\exception\TokenExpiredException;
use thans\jwt\exception\TokenInvalidException;
use thans\jwt\facade\JWTAuth;
use think\Exception;
use think\exception\HttpResponseException;
use think\Response;
use think\exception\ValidateException;

//use http\Client\Response;

class Jwt
{
    public $openid;

    public function __construct()
    {
        try {
            $payload = JWTAuth::auth();
//            p($payload);
            $this->openid = $payload[0]->getValue();

        } catch (\Exception $e) {
            throw new FailedException('登录用户不合法', 10004);
        }
    }

}